﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace UFIDA.U9.Learn.ItemUI
{
	[Serializable]
	public partial class ItemUIModel : UIModel
	{
		#region Constructor
		public ItemUIModel() : base("ItemUI")
		{
			InitClass();
			this.SetResourceInfo("e61fd2a9-63fb-4fc7-b780-648f9f4b0f0f");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private ItemUIModel(bool isInit) : base("ItemUI")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new ItemUIModel(false);
		}
		#endregion
		#region member
		#region views
		private ItemBEView viewItemBE;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public ItemBEView ItemBE
		{
			get { return (ItemBEView)this["ItemBE"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewItemBE = new ItemBEView(this);
			this.viewItemBE.SetResourceInfo("42b06f0e-f4f0-462c-b5c9-f4eadf49630d");
			this.Views.Add(this.viewItemBE);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.Learn.ItemUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class ItemBEView : UIView
	{
		#region Constructor
		public ItemBEView(IUIModel model) : base(model,"ItemBE","UFIDA.U9.Learn.ItemBE.ItemBE", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private ItemBEView():base(null,"ItemBE","UFIDA.U9.Learn.ItemBE.ItemBE", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new ItemBEView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}
		public IUIField FieldCreatedOn
		{
			get { return this.Fields["CreatedOn"]; }
		}
		public IUIField FieldCreatedBy
		{
			get { return this.Fields["CreatedBy"]; }
		}
		public IUIField FieldModifiedOn
		{
			get { return this.Fields["ModifiedOn"]; }
		}
		public IUIField FieldModifiedBy
		{
			get { return this.Fields["ModifiedBy"]; }
		}
		public IUIField FieldSysVersion
		{
			get { return this.Fields["SysVersion"]; }
		}
		public IUIField FieldCode
		{
			get { return this.Fields["Code"]; }
		}
		public IUIField FieldName
		{
			get { return this.Fields["Name"]; }
		}
		public IUIField FieldMemo
		{
			get { return this.Fields["Memo"]; }
		}
		public IUIField FieldItemType
		{
			get { return this.Fields["ItemType"]; }
		}
		public IUIField FieldUOM
		{
			get { return this.Fields["UOM"]; }
		}
		public IUIField FieldUOM_Code
		{
			get { return this.Fields["UOM_Code"]; }
		}
		public IUIField FieldUOM_Name
		{
			get { return this.Fields["UOM_Name"]; }
		}
		public IUIField FieldMaxPrice
		{
			get { return this.Fields["MaxPrice"]; }
		}
		public IUIField FieldLowPrice
		{
			get { return this.Fields["LowPrice"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public ItemBEDefaultFilterFilter DefaultFilter
		{
			get { return (ItemBEDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","c728f438-3253-4973-b1e1-f3277be5041c");
			UIModelRuntimeFactory.AddNewUIField(this,"CreatedOn", typeof(DateTime), true,"","System.DateTime", "CreatedOn", true,true, false, "",false,(UIFieldType)1,"3834a958-120f-4ac9-8d60-1a7be6d3f12f","bd2a7347-ecc5-4043-8fbd-e5951f02fcc1");
			UIModelRuntimeFactory.AddNewUIField(this,"CreatedBy", typeof(String), true,"","System.String", "CreatedBy", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","ce556443-fde4-4171-b8b7-c864341b28df");
			UIModelRuntimeFactory.AddNewUIField(this,"ModifiedOn", typeof(DateTime), true,"","System.DateTime", "ModifiedOn", true,true, false, "",false,(UIFieldType)1,"3834a958-120f-4ac9-8d60-1a7be6d3f12f","11172bf8-e691-4cf2-9ef2-04d1c37fb6c6");
			UIModelRuntimeFactory.AddNewUIField(this,"ModifiedBy", typeof(String), true,"","System.String", "ModifiedBy", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","1eb1ac43-18fc-4f40-9a82-00f1c7b1dab1");
			UIModelRuntimeFactory.AddNewUIField(this,"SysVersion", typeof(Int64), true,"0","System.Int64", "SysVersion", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","aaadcfcd-86b4-4597-85ea-29e65e6b4a2b");
			UIModelRuntimeFactory.AddNewUIField(this,"Code", typeof(String), true,"","System.String", "Code", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","9dd37739-8581-40a8-9195-8b30acb12591");
			UIModelRuntimeFactory.AddNewUIField(this,"Name", typeof(String), true,"","System.String", "Name", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","efcc6e56-6976-4025-bed6-c6d583b719da");
			UIModelRuntimeFactory.AddNewUIField(this,"Memo", typeof(String), true,"","System.String", "Memo", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","ae112951-3291-442f-9b80-d8c63fa8c5b3");
			UIModelRuntimeFactory.AddNewUIField(this,"ItemType", typeof(Int32), true,"0","UFIDA.U9.CBO.SCM.Item.ItemTypeEnum", "ItemType", true,true, false, "",false,(UIFieldType)2,"ad076435-3624-44f6-81cc-bf9ec91adb41","dd19888d-5b4a-4f07-8380-7d46879b93f7");
			UIModelRuntimeFactory.AddNewUIField(this,"UOM", typeof(Int64), true,"","UFIDA.U9.Base.UOM.UOM", "UOM", true,true, false, "",false,(UIFieldType)4,"ff454e91-0d57-445e-aef2-03cedea46843","0cae3e36-50fa-45a8-b796-9a9447577567");
			UIModelRuntimeFactory.AddNewUIField(this,"UOM_Code", typeof(String), false,"","System.String", "UOM.Code", false,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","dc13055b-a770-497e-9635-c161d3283b3a");
			UIModelRuntimeFactory.AddNewUIField(this,"UOM_Name", typeof(String), true,"","System.String", "UOM.Name", false,true, false, "",true,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","34670c1a-5986-4d1c-a1d7-36304a73ffae");
			UIModelRuntimeFactory.AddNewUIField(this,"MaxPrice", typeof(Decimal), true,"0","System.Decimal", "MaxPrice", true,true, false, "",false,(UIFieldType)1,"91031687-94bb-4988-a939-df7bf999ef4f","e4ee73cb-f9a1-47cb-8b3c-ea36e535160f");
			UIModelRuntimeFactory.AddNewUIField(this,"LowPrice", typeof(Decimal), true,"0","System.Decimal", "LowPrice", true,true, false, "",false,(UIFieldType)1,"91031687-94bb-4988-a939-df7bf999ef4f","f2b30308-050c-43b5-a01d-0fde0a59ef2a");


			this.CurrentFilter = new ItemBEDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new ItemBERecord(builder);
		}
		#endregion

		#region new method
		public new ItemBERecord FocusedRecord
		{
			get { return (ItemBERecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new ItemBERecord AddNewUIRecord()
		{	
			return (ItemBERecord)base.AddNewUIRecord();
		}
		public new ItemBERecord NewUIRecord()
		{	
			return (ItemBERecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class ItemBERecord : UIRecord
	{
		#region Constructor
		public ItemBERecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private ItemBEView uiviewItemBE
		{
			get { return (ItemBEView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new ItemBERecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewItemBE.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewItemBE.FieldID);
			}
			set{
				this[this.uiviewItemBE.FieldID] = value;
			}
		}
		
		
		public  DateTime? CreatedOn
		{
			get{
				//object value = this[this.uiviewItemBE.FieldCreatedOn] ;
				//return (DateTime?)value;
				return GetValue<DateTime?>(this.uiviewItemBE.FieldCreatedOn);
			}
			set{
				this[this.uiviewItemBE.FieldCreatedOn] = value;
			}
		}
		
		
		public  String CreatedBy
		{
			get{
				//object value = this[this.uiviewItemBE.FieldCreatedBy] ;
				//return (String)value;
				return GetValue<String>(this.uiviewItemBE.FieldCreatedBy);
			}
			set{
				this[this.uiviewItemBE.FieldCreatedBy] = value;
			}
		}
		
		
		public  DateTime? ModifiedOn
		{
			get{
				//object value = this[this.uiviewItemBE.FieldModifiedOn] ;
				//return (DateTime?)value;
				return GetValue<DateTime?>(this.uiviewItemBE.FieldModifiedOn);
			}
			set{
				this[this.uiviewItemBE.FieldModifiedOn] = value;
			}
		}
		
		
		public  String ModifiedBy
		{
			get{
				//object value = this[this.uiviewItemBE.FieldModifiedBy] ;
				//return (String)value;
				return GetValue<String>(this.uiviewItemBE.FieldModifiedBy);
			}
			set{
				this[this.uiviewItemBE.FieldModifiedBy] = value;
			}
		}
		
		
		public new Int64? SysVersion
		{
			get{
				//object value = this[this.uiviewItemBE.FieldSysVersion] ;
				//return (Int64?)value;
				return GetValue<Int64?>(this.uiviewItemBE.FieldSysVersion);
			}
			set{
				this[this.uiviewItemBE.FieldSysVersion] = value;
			}
		}
		
		
		public  String Code
		{
			get{
				//object value = this[this.uiviewItemBE.FieldCode] ;
				//return (String)value;
				return GetValue<String>(this.uiviewItemBE.FieldCode);
			}
			set{
				this[this.uiviewItemBE.FieldCode] = value;
			}
		}
		
		
		public new String Name
		{
			get{
				//object value = this[this.uiviewItemBE.FieldName] ;
				//return (String)value;
				return GetValue<String>(this.uiviewItemBE.FieldName);
			}
			set{
				this[this.uiviewItemBE.FieldName] = value;
			}
		}
		
		
		public  String Memo
		{
			get{
				//object value = this[this.uiviewItemBE.FieldMemo] ;
				//return (String)value;
				return GetValue<String>(this.uiviewItemBE.FieldMemo);
			}
			set{
				this[this.uiviewItemBE.FieldMemo] = value;
			}
		}
		
		
		public  Int32? ItemType
		{
			get{
				//object value = this[this.uiviewItemBE.FieldItemType] ;
				//return (Int32?)value;
				return GetValue<Int32?>(this.uiviewItemBE.FieldItemType);
			}
			set{
				this[this.uiviewItemBE.FieldItemType] = value;
			}
		}
		
		
		public  Int64? UOM
		{
			get{
				//object value = this[this.uiviewItemBE.FieldUOM] ;
				//return (Int64?)value;
				return GetValue<Int64?>(this.uiviewItemBE.FieldUOM);
			}
			set{
				this[this.uiviewItemBE.FieldUOM] = value;
			}
		}
		
		
		public  String UOM_Code
		{
			get{
				//object value = this[this.uiviewItemBE.FieldUOM_Code] ;
				//return (String)value;
				return GetValue<String>(this.uiviewItemBE.FieldUOM_Code);
			}
			set{
				this[this.uiviewItemBE.FieldUOM_Code] = value;
			}
		}
		
		
		public  String UOM_Name
		{
			get{
				//object value = this[this.uiviewItemBE.FieldUOM_Name] ;
				//return (String)value;
				return GetValue<String>(this.uiviewItemBE.FieldUOM_Name);
			}
			set{
				this[this.uiviewItemBE.FieldUOM_Name] = value;
			}
		}
		
		
		public  Decimal? MaxPrice
		{
			get{
				//object value = this[this.uiviewItemBE.FieldMaxPrice] ;
				//return (Decimal?)value;
				return GetValue<Decimal?>(this.uiviewItemBE.FieldMaxPrice);
			}
			set{
				this[this.uiviewItemBE.FieldMaxPrice] = value;
			}
		}
		
		
		public  Decimal? LowPrice
		{
			get{
				//object value = this[this.uiviewItemBE.FieldLowPrice] ;
				//return (Decimal?)value;
				return GetValue<Decimal?>(this.uiviewItemBE.FieldLowPrice);
			}
			set{
				this[this.uiviewItemBE.FieldLowPrice] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class ItemBEDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public ItemBEDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private ItemBEDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new ItemBEDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}